package com.zhny.iot.yy.collect.gateway.plugin;

import com.zhny.aiot.plugin.ICenterFacilities;
import com.zhny.aiot.plugin.IDevice;
import com.zhny.aiot.plugin.model.DeviceEntity;
import com.zhny.aiot.plugin.model.FactoryType;
import com.zhny.aiot.plugin.model.StoreEntity;
import com.zhny.aiot.plugin.mqtt.MqttDeviceFactory;
import com.zhny.iot.yy.collect.gateway.plugin.model.YYCollectGatewayStoreEntry;
import org.pf4j.Extension;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;

public class YYCollectGatewayPlugin extends Plugin {
    public YYCollectGatewayPlugin(PluginWrapper wrapper) {
        super (wrapper);
    }
    @Extension
    public static class YYCollectGatewayFactory extends MqttDeviceFactory<YYCollectGatewayConfig> {


        @Override
        public IDevice createDevice(ICenterFacilities iCenterFacilities, DeviceEntity entity) {
            return new YYCollectGatewayDevice (this,iCenterFacilities,entity);
        }

        @Override
        public Class<YYCollectGatewayConfig> configClass() {
            return YYCollectGatewayConfig.class;
        }

        @Override
        public Class<? extends StoreEntity> storeClass() {
            return YYCollectGatewayStoreEntry.class;
        }

        @Override
        public String getId() {
            return "yy-mqtt-collect-gateway";
        }

        @Override
        public String getName() {
            return "渔业数据采集网关";
        }

        @Override
        public FactoryType getType() {
            return FactoryType.Integrate;
        }
    }
}
